package com.egdigital.allzic.data.object;

import android.os.Parcel;
import android.os.Parcelable;

public class Category implements Parcelable {

	private int		mId;
	private String	mTitle;
	public int		isFavorite;

	public Category(int id, String title) {
		mId = id;
		mTitle = title;
		isFavorite = 0;
	}

	public int getId() {
		return mId;
	}

	public void setId(int id) {
		mId = id;
	}

	public String getTitle() {
		return mTitle;
	}

	public void setTitle(String title) {
		mTitle = title;
	}

	@Override
	public String toString() {
		return String.format("%s %s \n", mId, mTitle);
	}

	/**
	 * parcel
	 */
	public Category(Parcel parcel) {
		mId = parcel.readInt();
		mTitle = parcel.readString();
		isFavorite = parcel.readInt();
	}

	public int describeContents() {
		// not used
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(mId);
		dest.writeString(mTitle);
		dest.writeInt(isFavorite);
	}

	public static Creator<Category>	CREATOR	= new Creator<Category>() {

												public Category createFromParcel(Parcel parcel) {
													return new Category(parcel);
												}

												public Category[] newArray(int size) {
													return new Category[size];
												}
											};
}
